<template>
  <div class="box-container">
    <el-table
      :data="ordersList"
      border
      stripe
      style="width: 100%"
    >
      <el-table-column
        type="index"
        label="#"
        width="48"
      />
      <el-table-column
        prop="order_number"
        label="订单编号"
        width="250"
      />
      <el-table-column
        prop="order_price"
        label="订单价格"
      />
      <el-table-column
        prop="order_pay"
        label="是否付款"
      >
        <template slot-scope="{row}">
          <el-tag v-if="row.order_pay==='1'" effect="dark" size="mini">已付款</el-tag>
          <el-tag v-else type="danger" effect="dark" size="mini">未付款</el-tag>
        </template>
      </el-table-column>
      <el-table-column
        prop="is_send"
        label="是否发货"
      />
      <el-table-column
        label="下单时间"
      >
        <template slot-scope="{row}">
          {{ row.create_time | relativeTime }}
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        width="120"
      >
        <template slot-scope="{row}">
          <el-tooltip class="item" effect="dark" content="修改订单地址" placement="top">
            <el-button type="primary" size="mini" icon="el-icon-edit" @click="$emit('on-edit',row.order_id)" />
          </el-tooltip>
          <el-tooltip class="item" effect="dark" content="物流信息" placement="top">
            <el-button type="success" size="mini" icon="el-icon-location" @click="$emit('on-local',row.order_id)" />
          </el-tooltip>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: {
    ordersList: {
      type: Array,
      required: true
    }
  },
  data() {
    return {
    }
  },
  created() {
  },
  methods: {
  }
}
</script>

<style scoped lang='scss'>
.el-table{
  margin-top: 15px;
  font-size: 12px;
}
</style>
